package cn.cosmosx.base.define;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@ApiModel(description = "分页查询")
public class PageQuery<T>{

    @ApiModelProperty(value = "页数 默认第1页", notes = "1", example = "1")
    protected long current = 1;

    @ApiModelProperty(value = "每页显示条数 默认20条", notes = "10", example = "10")
    protected long size = 10;

    @ApiModelProperty(value = "查询参数")
    protected T queryParam;

    @ApiModelProperty(value = "Mapper page查询参数", hidden = true)
    protected IPage<?> page;

    public IPage<?> getPage() {
        return Page.of(current, size);
    }
}
